import asyncRouterMap from '../router/homeRoutes'
const routerList = []
const roles = window.sessionStorage.getItem('role')
const routes = () => {
  if (!asyncRouterMap) {
    return
  }
  asyncRouterMap.forEach(item => {
    if (item.children) {
      item.children.forEach(item2 => {
        if (item2.title) {
          item2.roles.forEach(item3 => {
            if (item3 === roles) {
              routerList.push(item2)
            }
          })
        }
      })
    }
  })
  return routerList
}
export default routes